<?php
namespace app\common\model;
use think\model\concern\SoftDelete;

class CpRegionWs extends TyModel {

    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;

    //使用状态
    public function getUseStatusNameAttr($value,$data){
        $status = [0 => '空置',1 => '有人',2 => '无人'];
        return $status[$data['use_status']];
    }

    //完成状态
    public function getStatusNameAttr($value,$data){
        $status = [0 => '未完成',1 => '已完成'];
        return $status[$data['status']];
    }

    //周末/节假日是否加班
    public function getIsHolidayWorkNameAttr($value,$data){
        $status = [0 => '否',1 => '是'];
        return $status[$data['is_holiday_work']];
    }

    //晚上是否加班
    public function getIsEveningWorkNameAttr($value,$data){
        $status = [0 => '否',1 => '是'];
        return $status[$data['is_evening_work']];
    }
}